<?php

namespace Common\Model;
use Common\Model\AllModel;

/**
 * 退单申请，其中退货状态一个产品只允许一次
 * 
 * @author xiaoyutab<xiaoyutab@qq.com>
 * @version v1.0.0
 * @copyright (c) 2017, xiaoyutab
 * @adtime 2018-06-22 23:42:15
 */
class OrderRebackModel extends AllModel{
    protected $_type = [
        1 => '退货',
        2 => '换货',
        3 => '维修',
    ];
    
    protected $_status = [
        1 => '已申请',
        2 => '已拒绝',
        99 => '已同意',
        98 => '已删除',
    ];
    
    /**
     * 获取状态详情
     * 
     * @param type $status
     * @return type
     */
    public function get_config($status,$type = 'status'){
        if($status){
            $type = '_'.$type;
            return $this->$type[$status]?$this->$type[$status]:'未知';
        }
        return $this->$type;
    }
}